<?php
/**
 * RedCross Application
 *
 * @copyright Copyright (c) 2010, Kristian Stokke Tryggestad, Rune Vikestad, Andreas Flaten Wist, Simen Nicolai Echholt, Ole Henrik Jahren
 */

/**
 * View Helper for setting the html <h1> header for a page
 *
 * @package RedCross_View
 * @category RedCross
 */
class RedCross_View_Helper_PageHeader extends Zend_View_Helper_Placeholder
{
    /**
     * Method that Zend_View will load behind the scenes when we want to use the helper
     * @return RedCross_View_Helper_PageHeader
     */
    public function pageHeader($value = null)
    {
        if (is_null($value)) {
        	return $this;
        }
        return $this->set($value);
    }

    /**
     * Method that sets the content of the page header
     * @param string $value
     * @return void
     */
    public function set($value)
    {
        parent::placeholder('pageHeader')->set($value);
    }

    /**
     * Returns the content of the page header
     * @return string
     */
    public function get()
    {
        return (string) parent::placeholder('pageHeader');
    }

    /**
     * Returns the content of the page header
     * @return string
     */
    public function __toString()
    {
        return $this->get();
    }
}